package com.ruoyi.siyun.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.siyun.mapper.SyCourseMapper;
import com.ruoyi.siyun.domain.SyCourse;
import com.ruoyi.siyun.service.ISyCourseService;

/**
 * 课程Service业务层处理
 * 
 * @author theguo
 * @date 2024-12-19
 */
@Service
public class SyCourseServiceImpl implements ISyCourseService 
{
    @Autowired
    private SyCourseMapper syCourseMapper;

    /**
     * 查询课程
     * 
     * @param id 课程主键
     * @return 课程
     */
    @Override
    public SyCourse selectSyCourseById(Long id)
    {
        return syCourseMapper.selectSyCourseById(id);
    }

    /**
     * 查询课程列表
     * 
     * @param syCourse 课程
     * @return 课程
     */
    @Override
    public List<SyCourse> selectSyCourseList(SyCourse syCourse)
    {
        return syCourseMapper.selectSyCourseList(syCourse);
    }

    /**
     * 新增课程
     * 
     * @param syCourse 课程
     * @return 结果
     */
    @Override
    public int insertSyCourse(SyCourse syCourse)
    {
        syCourse.setCreateTime(DateUtils.getNowDate());
        return syCourseMapper.insertSyCourse(syCourse);
    }

    /**
     * 修改课程
     * 
     * @param syCourse 课程
     * @return 结果
     */
    @Override
    public int updateSyCourse(SyCourse syCourse)
    {
        syCourse.setUpdateTime(DateUtils.getNowDate());
        return syCourseMapper.updateSyCourse(syCourse);
    }

    /**
     * 批量删除课程
     * 
     * @param ids 需要删除的课程主键
     * @return 结果
     */
    @Override
    public int deleteSyCourseByIds(Long[] ids)
    {
        return syCourseMapper.deleteSyCourseByIds(ids);
    }

    /**
     * 删除课程信息
     * 
     * @param id 课程主键
     * @return 结果
     */
    @Override
    public int deleteSyCourseById(Long id)
    {
        return syCourseMapper.deleteSyCourseById(id);
    }
}
